package com.situ.mall.base.mapper;

import com.situ.mall.base.entity.Member;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.situ.mall.base.vo.CountVO;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author darling
 * @since 2023-03-20
 */
public interface MemberMapper extends BaseMapper<Member> {

    List<Member> doList(@Param("keyword") String keyword, @Param("status") Integer status);

    void start(Integer id);

    void stop(Integer id);

    @Select("SELECT COUNT(1) FROM t_member")
    Long statistics();

    List<CountVO> statisticMemberByYear();

    List<CountVO> statisticMemberByMonth();

    @Select("SELECT * FROM t_member WHERE username = #{username}")
    Member selectByUsername(String username);


}
